/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cuentasCobrar;

import conexion.CConexion;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.table.DefaultTableModel;
import validaciones.CLogin;

/**
 *
 * @author SISTEMAS
 */
public class CCxc101 extends CConexion {

    CLogin loginU = new CLogin();

    public CCxc101() {
        super();
    }

    public ResultSet maxNumeroSerie(DefaultTableModel Table2, int rowTable2) throws SQLException {
        ResultSet rsMaxNumeroSerie = null;
        Statement stncMaxNumeroSerie = this.getConexion().createStatement();
        String sqlMaxNumeroSerie = "select max(cxc101nose) from cxc101 where cxc101nocia = '" + loginU.getCompaniaActual() + "' and cxc101alma = '" + Table2.getValueAt(rowTable2, 5) + "' and cxc101tido = '" + Table2.getValueAt(rowTable2, 0) + "' and cxc101nodo = '" + Table2.getValueAt(rowTable2, 6) + "'";
        rsMaxNumeroSerie = stncMaxNumeroSerie.executeQuery(sqlMaxNumeroSerie);
        rsMaxNumeroSerie.next();
        return rsMaxNumeroSerie;
    }
}
